package com.kingmed.kmss.bpmn.modules.backup.controller;


import com.kingmed.kmss.bpmn.flow.service.app.AppTaskService;
import com.kingmed.kmss.common.bo.bpmn.BizApprovalStatusBo;
import com.kingmed.kmss.common.qc.bpmn.MyTaskQC;
import com.kingmed.kmss.common.vo.CommonPage;
import com.kingmed.kmss.common.vo.CommonResponse;
import com.kingmed.kmss.common.vo.bpmn.TaskVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 需补充审批功能所需要的任务类接口，包括任务认领，任务执行（通过/驳回)，我的待办任务，我的已办任务等接口
 * </p>
 */
@RestController
@Slf4j
@RequestMapping("/ext")
@Api(tags = "bpmn-移动端-任务管理")
public class AppTaskController {

    @Autowired
    AppTaskService appTaskService;


	@ApiOperation("移动端 - 待我审批列表")
    @PostMapping(value = "/task/appTodo")
    public CommonResponse<CommonPage<TaskVo>> myAppTodo(@RequestBody MyTaskQC param) {
        return appTaskService.myAppTodo(param);
    }

    @ApiOperation("移动端 - 我已提交列表")
    @PostMapping(value = "/process/myAppSubmitted")
    public CommonResponse<CommonPage<BizApprovalStatusBo>> myAppSubmitted(@RequestBody MyTaskQC param) {
        return appTaskService.myAppSubmitted(param);
    }

    @ApiOperation("移动端 - 我已审批列表")
    @PostMapping(value = "/process/appApproved/mine")
    public CommonResponse<CommonPage<BizApprovalStatusBo>> myAppApprovedProcess(@RequestBody MyTaskQC param) {
        return appTaskService.myAppApprovedProcess(param);
    }

}
